Skip to content

WIP: Prepare Unsigned integer types for SwiftKit#312

Closed
ktoso wants to merge 2 commits into
mainfrom
wip-unsigned
Closed

WIP: Prepare Unsigned integer types for SwiftKit#312
ktoso wants to merge 2 commits into
mainfrom
wip-unsigned

Conversation

@ktoso

@ktoso ktoso commented Jul 13, 2025

Copy link
Copy Markdown
Collaborator

Using these we'll be able to use them to more safely express unsigned types, rather than just pretend it's all the same and fine when we import them into signed java types.

We'll also be able to offer extract mode that can just ignore this and extract as raw int/long etc, but these APIs may be safer

@ktoso ktoso marked this pull request as draft July 13, 2025 11:16
* @param bits bit value to store in this unsigned integer
* @return unsigned integer representation of the passed in value
*/
public static UnsignedByte representedByBitsOf(byte bits) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: benchmark if it's worth it

@ktoso

ktoso commented Jul 14, 2025

Copy link
Copy Markdown
Collaborator Author

WIP towards resolving #307

@ktoso

ktoso commented Jul 14, 2025

Copy link
Copy Markdown
Collaborator Author

This is WIP and I need to confirm how to attribute Guava so we can reuse some of the nicer conversion logic UnsignedLong -> floating points etc. We'll do a NOTICE.txt but need to check how to attribute in specific files.

@ktoso ktoso closed this Jul 29, 2025
@ktoso ktoso deleted the wip-unsigned branch December 8, 2025 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant